package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 交接任务
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_handover")
@ApiModel(value = "Handover", description = "交接任务")
public class HandoverEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 主记录id
     */
    @ApiModelProperty(value = "主记录id")
    @NotNull(message = "主记录id不能为空", groups = {Save.class})
    @TableField(value = "master_id")
    private Long masterId;
    /**
     * 交接任务单号
     */
    @ApiModelProperty(value = "交接任务单号")
    @NotEmpty(message = "交接任务单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "交接任务单号长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 出库单号
     */
    @ApiModelProperty(value = "出库单号")
    @NotEmpty(message = "出库单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "出库单号长度不能超过50")
    @TableField(value = "outbound_code")
    private String outboundCode;
    /**
     * 配送方式
     */
    @ApiModelProperty(value = "配送方式")
    @NotEmpty(message = "配送方式不能为空", groups = {Save.class})
    @Length(max = 10, message = "配送方式长度不能超过10")
    @TableField(value = "delivery_type")
    private String deliveryType;
    /**
     * 承运商id
     */
    @ApiModelProperty(value = "承运商id")
    @NotNull(message = "承运商id不能为空", groups = {Save.class})
    @TableField(value = "carrier_id")
    private Long carrierId;
    /**
     * 运单编号
     */
    @ApiModelProperty(value = "运单编号")
    @NotEmpty(message = "运单编号不能为空", groups = {Save.class})
    @Length(max = 50, message = "运单编号长度不能超过50")
    @TableField(value = "bill_code")
    private String billCode;
    /**
     * 交接员
     */
    @ApiModelProperty(value = "交接员")
    @Length(max = 10, message = "交接员长度不能超过10")
    @TableField(value = "handover_name")
    private String handoverName;
    /**
     * 交接完成时间
     */
    @ApiModelProperty(value = "交接完成时间")
    @TableField(value = "completion_time")
    private java.time.LocalDateTime completionTime;
    /**
     * 司机姓名
     */
    @ApiModelProperty(value = "司机姓名")
    @NotEmpty(message = "司机姓名不能为空", groups = {Save.class})
    @Length(max = 10, message = "司机姓名长度不能超过10")
    @TableField(value = "driver_name")
    private String driverName;
    /**
     * 司机电话
     */
    @ApiModelProperty(value = "司机电话")
    @NotEmpty(message = "司机电话不能为空", groups = {Save.class})
    @Length(max = 20, message = "司机电话长度不能超过20")
    @TableField(value = "driver_phone")
    private String driverPhone;
    /**
     * 交接状态 1新建、2交接中、3交接完成
     */
    @ApiModelProperty(value = "交接状态 1新建、2交接中、3交接完成")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
